from subprocess import run

def check_ping(host):
    result = run(["ping","-4","-n","1","-w","1",host],capture_output=True)
    if result.returncode == 0:
        return True
    else:
        # print(host + "连接失败，请检查")
        return False